﻿using MediatR;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using S.Weaning.Domain;
using S.Weaning.Infrastructure;
using S.Weaning.Infrastructure.Interface;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using S.Weaning.Domain.Dto;
using S.Common.ApiResult;

namespace S.Weaning.ApI.Application.Command
{
    public class MaternalWeaningCommand
    {
        public class AddMaternalMatingCommand : IRequest<int>
        {
            /// <summary>
            /// 断奶日期
            /// </summary>
            public DateTime? WeaningDate { get; set; }
            /// <summary>
            /// 负责人
            /// </summary>
            public int UserId { get; set; }
            /// <summary>
            /// 单据号
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? DocumentNumber { get; set; }
            /// <summary>
            /// 流水号
            /// </summary>
            [Column(TypeName = "nvarchar(100)")]
            [MaxLength(100)]
            public string? SerialNumber { get; set; }
            /// <summary>
            /// 备注
            /// </summary>
            [Column(TypeName = "nvarchar(200)")]
            [MaxLength(200)]
            public string? Notes { get; set; }
            public List<ShwoMaternalWarning>? maternalWarnings { get; set; }
            /// <summary>
            /// 反填种母历史记录
            /// </summary>
            public EditBreed editBreed { get; set; }

        }
        /// <summary>
        /// 进行审核
        /// </summary>
        public class UpdExamineCommand : IRequest<bool>
        {
            public UpdExamineCommand(string ids)
            {
                this.Ids = ids;

            }
            public string Ids { get; set; }
        }
        public class EditBreed
        {
            /// <summary>
            /// 可视耳号
            /// </summary>
            public string? EarTag { get; set; }
        }
        public class ShwoMaternalWarning
        {
            /// <summary>
            /// 电子耳号
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? EITag { get; set; }
            /// <summary>
            /// 可视耳号
            /// </summary>
            public string EarTag { get; set; }
            /// <summary>
            /// 哺乳天数
            /// </summary>
            public int? LactationDay { get; set; }

            /// <summary>
            /// 当前栋舍
            /// </summary>

            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? TurnOutBuild { get; set; }

            /// <summary>
            /// 当前栏位
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? TurnOutHuts { get; set; }

            /// <summary>
            /// 转入栋舍
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? TransferBuilding { get; set; }

            /// <summary>
            /// 转入栏位
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? TransferField { get; set; }

            /// <summary>
            /// 断奶只数
            /// </summary>
            public int WeaningCount { get; set; }

            /// <summary>
            /// 断奶总窝重（公斤）
            /// </summary>
            [Column(TypeName = "decimal(10,2)")]
            public decimal TotalweaningWeightg { get; set; }

            /// <summary>
            /// 种母重量（公斤）
            /// </summary>
            [Column(TypeName = "decimal(10,2)")]
            public decimal SeedMotherWeightg { get; set; }

            /// <summary>
            /// 创建人
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? CreateBy { get; set; }

            /// <summary>
            /// 创建时间
            /// </summary>
            public DateTime? CreateDate { get; set; }
        }
        /// <summary>
        /// 删除
        /// </summary>
        public class DelMaternalCommand : IRequest<bool>
        {
            public DelMaternalCommand(string ids)
            {
                this.ids = ids;
            }
            public string ids { get; set; }
        }
        /// <summary>
        /// 修改种母断奶信息
        /// </summary>
        public class UpdMaternalCommand: IRequest<bool>
        {
            public int MaternalWeaningId { get; set; }
            /// <summary>
            /// 断奶日期
            /// </summary>
            public DateTime? WeaningDate { get; set; }
            /// <summary>
            /// 负责人
            /// </summary>
            public int UserId { get; set; }
            /// <summary>
            /// 备注
            /// </summary>
            [Column(TypeName = "nvarchar(200)")]
            [MaxLength(200)]
            public string? Notes { get; set; }
            /// <summary>
            /// 可视耳号
            /// </summary>
            public string EarTag { get; set; }
            /// <summary>
            /// 哺乳天数
            /// </summary>
            public int? LactationDay { get; set; }

            /// <summary>
            /// 当前栋舍
            /// </summary>

            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? TurnOutBuild { get; set; }

            /// <summary>
            /// 当前栏位
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? TurnOutHuts { get; set; }

            /// <summary>
            /// 转入栋舍
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? TransferBuilding { get; set; }

            /// <summary>
            /// 转入栏位
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? TransferField { get; set; }

            /// <summary>
            /// 断奶只数
            /// </summary>
            public int WeaningCount { get; set; }

            /// <summary>
            /// 断奶总窝重（公斤）
            /// </summary>
            [Column(TypeName = "decimal(10,2)")]
            public decimal TotalweaningWeightg { get; set; }

            /// <summary>
            /// 种母重量（公斤）
            /// </summary>
            [Column(TypeName = "decimal(10,2)")]
            public decimal SeedMotherWeightg { get; set; }
            /// <summary>
            /// 修改人
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? UpdateBy { get; set; }

            /// <summary>
            /// 修改时间
            /// </summary>
            public DateTime? UpdateDate { get; set; }
        }
    }
}
